<template>
  <div>
    <input
     type="text"
     placeholder="请输入内容"
     ref="inputvaluefocus"
     v-model="inputValue"
     @keydown.enter="AddtoList"
     >
    <button @click.prevent="AddtoList">添加</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      inputValue: ''
    }
  },
  methods: {
    AddtoList() {
      this.$store.commit('VuexAddtoList',this.inputValue)
      this.inputValue = ''
      this.$refs.inputvaluefocus.focus()
    }
  }
}
</script>

<style>

</style>
